package com.automobile.backstage.controller;

import com.automobile.backstage.domain.BeanBrandTypeCategory;
import com.automobile.backstage.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 类的作用
 *
 * @author liujiamiao
 * @email 2544296058@qq.com
 * @date 2020-03-17 22:28
 */
@Controller
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @RequestMapping("/get")
    public @ResponseBody BeanBrandTypeCategory get(){
        BeanBrandTypeCategory bean =new BeanBrandTypeCategory();
        bean.setCateBrands(categoryService.findCarBrandAll());
        bean.setCarTypes(categoryService.findCarTypeAll());

        return bean;
    }


}
